package com.chenfan.mcn.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedBaseMapper;
import com.chenfan.mcn.model.AeExcutorConfirm;
import com.chenfan.mcn.model.AeRoyalties;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.AeExcutorConfirmNewDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author chenguopeng
 * @Date 2021/6/17 14:23
 */
public interface AeExcutorConfirmMapper extends EnhancedBaseMapper<AeExcutorConfirm> {
    /**
     * 修改确认状态
     *
     * @param aeExcutorConfirmNewDTO
     */
    void updateConfirm(AeExcutorConfirmNewDTO aeExcutorConfirmNewDTO);

    /**
     * 获取个人提成金额
     *
     * @param aeQuarterlyId {@link Long}
     * @param executorIds   {@link List<Long>}
     * @return {@link List<AeRoyalties>}
     */
    List<AeRoyalties> getExecutorTotalMoney(@Param("aeQuarterlyId") Long aeQuarterlyId, @Param("executorIds") List<Long> executorIds);

    /**
     * 获取部分负责人提成金额
     *
     * @param aeQuarterlyId       {@link Long}
     * @param departmentHeaderIds {@link List<Long>}
     * @return {@link List<AeRoyalties>}
     */
    List<AeRoyalties> getDepPrincipalMoney(@Param("aeQuarterlyId") Long aeQuarterlyId, @Param("departmentHeaderIds") List<Long> departmentHeaderIds);

    /**
     * 获取部分负责人提成金额(作废状态)
     *
     * @param id                  {@link Long}
     * @param departmentHeaderIds {@link List<Long>}
     * @return {@link List<AeRoyalties>}
     */
    List<AeRoyalties> getDepPrincipalMoneyInvalid(@Param("id") Long id, @Param("departmentHeaderIds") List<Long> departmentHeaderIds);

    /**
     * 获取个人提成金额(作废状态)
     *
     * @param id          {@link Long}
     * @param executorIds {@link List<Long>}
     * @return {@link List<AeRoyalties>}
     */
    List<AeRoyalties> getExecutorTotalMoneyInvalid(@Param("id") Long id, @Param("executorIds") List<Long> executorIds);

    /**
     * 获取未删除的确认详情数据
     *
     * @param mcnPage                分页
     * @param aeQuarterlyId          提成id
     * @param executorIdList         执行人id
     * @param depPrincipalNameIdList 部门负责人id
     * @return 确认详情数据
     */
    Page<AeExcutorConfirm> getAeExecutorConfirmList(McnPage<AeExcutorConfirm> mcnPage, @Param("aeQuarterlyId") Long aeQuarterlyId, @Param("executorIdList") List<Long> executorIdList, @Param("depPrincipalNameIdList") List<Long> depPrincipalNameIdList);
}
